#include "ServerCal.hpp"
#include "TcpServer.hpp"

void Usage(std::string proc)
{
    std::cout << "\r\nUsage:" << proc << " port" << std::endl;
}

int main(int argc, char *argv[])
{
    // ./ServerCal port
    if(argc != 2)
    {
        Usage(argv[0]);
        exit(0);
    }

    //port
    uint16_t Serverport = stoi(argv[1]);

    //启动服务器
    TcpServer Sver(Serverport, std::bind(&ServerCal::calculator, ServerCal(), placeholders::_1));

    Sver.ServerInit();

    // Sver.InitServer();

    Sver.ServerStart();

    return 0;
}